<!--
 * @Author: zhw 443844039@qq.com
 * @Date: 2025-08-02 19:32:17
 * @LastEditors: zhw 443844039@qq.com
 * @LastEditTime: 2025-08-11 20:47:22
 * @FilePath: \project\lingyuxx-jxjsdad\ruoyi-ui\src\views\workbench\components\WorkbenchFunctions.vue
 * @Description: 工作台功能卡片组件，包含系统功能入口
-->
<template>
  <div class="content-row">
    <div class="function-card">
      <div class="card-header">
        <span>我的功能</span>
      </div>
      
      <div class="functions-container">
        <!-- 我的收藏 -->
        <div class="function-item" @click="handleClick('1')">
          <div class="function-images">
            <img src="@/assets/workbench/u663.png" alt="收藏内容1" class="function-img">
          </div>
          <div class="function-info">
            <h3>我的收藏</h3>
            <p>自主保存的内容集合，便于随时查看与管理。</p>
          </div>
          <div class="function-arrow">
            <img src="@/assets/workbench/u665.png" alt="我的收藏箭头" class="arrow-img">
          </div>
        </div>

        <!-- 我的推荐 -->
        <div class="function-item" @click="handleClick('2')">
          <div class="function-images">
            <img src="@/assets/workbench/u669.png" alt="推荐内容1" class="function-img">
          </div>
          
          <div class="function-info">
            <h3>我的推荐</h3>
            <p>基于用户行为、偏好等数据，智能筛选与聚合，实现便捷浏览与管理。</p>
          </div>
          
          <div class="function-arrow">
            <img src="@/assets/workbench/u670.png" alt="推荐内容箭头" class="arrow-img">
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { documentFavoriteListApi } from '@/api/favorite'
import { documentRecommendListApi } from '@/api/recommend'
import { searchList, listColumns, actionArr } from './data'
export default {
  name: 'TheWorkbenchCard',
  data() {
    return {
      searchList,
      listColumns,
      actionArr,
      documentFavoriteListApi,
      documentRecommendListApi,
      api: null
    }
  },
  methods:{
    handleClick(val) {
      let path = '/workbench/mineList?action='+val;
      this.$router.push(path);
      // this.api = val=='1'?this.documentFavoriteListApi: this.documentRecommendListApi
      // this.$refs.TheworkbenchTableRef.showModel = true
    }
  }
}
</script>

<style scoped>
.content-row {
  margin-bottom: 12px;
}

.function-card {
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin: 0 auto;
}

.card-header {
  font-size: 16px;
  font-weight: bold;
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
}

.functions-container {
  display: flex;
  gap: 20px;
  padding: 10px 20px;
  flex-wrap: wrap;
}

.function-item {
  padding: 20px;
  border: 1px dashed #f0f0f0;
  border-radius: 8px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 300px;
  max-width: calc(50% - 10px);
}

.function-item:hover {
  background-color: #f5f7fa;
  border-color: #e0e0e0;
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.function-images {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
}

.function-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.function-item:nth-child(1) .function-img {
  background-color: #1990FF;
}

.function-item:nth-child(2) .function-img {
  background-color: #F59A23;
}

.function-item:hover .function-img {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.function-info {
  flex: 1;
  min-width: 0;
}

.function-info h3 {
  font-size: 16px;
  color: #333;
  margin-bottom: 8px;
}

.function-info p {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.function-arrow {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

.arrow-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.function-item:hover .arrow-img {
  opacity: 1;
}
</style>
